package com.kgc.ssm.service.impl;


import com.kgc.ssm.bean.Provider;
import com.kgc.ssm.mapper.ProviderMapper;
import com.kgc.ssm.service.ProviderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created On : 2022/8/15.
 * <p>
 * Author : shiguangchuan
 * <p>
 * Description: ProviderServiceImpl
 */
@Service
public class ProviderServiceImpl implements ProviderService {

    @Autowired
    private ProviderMapper providerMapper;

    @Override
    public int getProviderCountByCondition(String queryProCode, String queryProName) {
        return providerMapper.selectProviderCountByCondition(queryProCode, queryProName);
    }

    @Override
    public List<Provider> getProviderListByCondition(String queryProCode, String queryProName, Integer pageNo, Integer pageSize) {
        return providerMapper.selectProviderListByCondition(queryProCode, queryProName, pageNo, pageSize);
    }

    @Override
    public void delProviderById(Integer id) {
        providerMapper.deleteProviderById(id);
    }

    @Override
    public Provider getProviderById(Integer id) {
        return providerMapper.selectProviderById(id);
    }

    @Override
    public void modProviderById(Provider providerForm) {
        providerMapper.updateProviderById(providerForm);
    }

    @Override
    public void addProviderInfo(Provider providerForm) {
        providerMapper.insertProviderInfo(providerForm);
    }

    @Override
    public List<Provider> getAllProvider() {
        return providerMapper.selectAllProvider();
    }
}
